import {defineStore} from "pinia";
import {ref} from "vue";

export const userInfoStore = defineStore("userInfo", () => {
    const user = ref({
        id: "",
        nickname: "",
        gender: "",
        signature: "",
    })
    const token = ref("")
    const setUser = (data: any) => {
        user.value = data;
    }
    const setToken = (newToken: string) => {
        token.value = newToken;
    }
    return {user, token, setUser, setToken}

}, {
    persist: {
        storage: sessionStorage,
    }

})
